package 合并函数

fun main() {
    //使用zip函数
    val employees = listOf("Jack", "Jason", "Tommy")
    val ages = listOf(18, 20, 30)

    val employeeAges = employees.zip(ages).toMap()
    println(employeeAges["Jason"])

    ////////////////////////////////////////////////////////////

    //使用fold函数
    val foldedValue = listOf(1, 2, 3, 4).fold(0) { accmulator, number ->
        println("Accmulator value:$accmulator")
        accmulator + (number * 3)
    }
    println("Final value:$foldedValue")
}